package com.qf.hospital.serialize;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;

import java.io.IOException;
import java.time.chrono.JapaneseEra;

/**
 * @author ASUS
 * @version V1.0
 * @Project hospital
 * @Package com.qf.hospital.serialize
 * @Date 2021/10/19 11:04
 */
public class Integer2BooleanJsonSerialize extends JsonSerializer<Integer> {

    @Override
    public void serialize(Integer integer, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
        jsonGenerator.writeBoolean(integer == 1);
    }
}
